# == Schema Information
#
# Table name: groups
#
#  id         :integer          not null, primary key
#  name       :string(255)
#  created_at :datetime
#  updated_at :datetime
#

class Group < ActiveRecord::Base
  validates_presence_of :name

  has_many :radusergroups, :dependent => :destroy, :primary_key => :name, :foreign_key => :groupname
  has_many :users, :through => :radusergroups

  has_many :radgroupchecks, :dependent => :destroy
  has_many :radgroupreplies, :dependent => :destroy
end
